package com.zqx.microservice_simple_provider_user.controller;

import com.zqx.microservice_simple_provider_user.Repository.UserRepository;
import com.zqx.microservice_simple_provider_user.dataobject.User;
import org.springframework.beans.factory.annotation.Autowired;
/*import org.springframework.web.bind.annotation.GetMapping;*/
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    private UserRepository userRepository;

    /*@GetMapping("/{id}")*/
    @RequestMapping("/{id}")
    public User findById(@PathVariable Long id)
    {
        User user = userRepository.findOne(id);/*.findById(id).get();*/
        return user;
    }
}
